Skip to content

feat(core,objectql,spec,service-record-context,mcp,runtime)!: a context pack is identified by its package and its name; get_record_context selects a pack by its face on both MCP doors - #37291

Merged
os-zhuang merged 13 commits into
mainfrom
claude/issue-37216-ai-context-package-scope
Nov 25, 2026
Merged

os-zhuang merged 13 commits into
mainfrom
claude/issue-37216-ai-context-package-scope

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ
Fixes #37216
Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #37177

维护者速读

  • 用户能看到什么变化:两个应用各自带了同名的资料包时,外部 AI 通过 MCP 读取记录资料能按“应用+名字”分别选到各自的包;只给名字且有两个应用都带这个名字时,会被明确拒绝并列出每个可选的写法。
  • 为什么做:属于“在一条记录上问 AI”专题,落实已合并的资料包身份裁决(资料包按应用+名字认),也为后续“技能指定资料包”那张卡扫清前提。
  • 出错会怎样:只影响资料包的选取与同名校验;第一方应用里没有任何同名资料包,现有部署读到的结果不变,可直接撤回。
  • 要你做什么:这是收窄改动,请你批准;批准后由席位合入。契约审核通过记录是 PR comment 7168612536,Head-sha 7408543965b4dbbc8e51cf8033e51106d2e2f79d。

What changes

ADR-0150's addendum (PR #37209, merged by the maintainer) puts the context pack in bucket 3 beside skill: a pack is identified by its package and its name.

  • The four lists. ai_context joins PACKAGE_SCOPED_TYPES (packages/core/src/package-scoped-resolution.ts, the one ADR-0150 D3 rule), PACKAGE_SCOPED_READ_TYPES (packages/objectql/src/package-scoped-read.ts, the /meta by-name read and its ?package= qualifier), PACKAGE_SLOTTED_METADATA_TYPES (packages/spec/src/api/protocol.zod.ts, the metadata service's per-(package, name) slot; uninstall drops one package's pack and keeps another's) and NAMESPACE_UNIQUE_TYPES (packages/objectql/src/namespace-co-owner-names.ts, D2's refusal of a second holder inside one namespace, at install and in os validate).
  • Reader 1, pack selection (packages/services/service-record-context/src/read-set.ts). Candidates are still the packs rooted on objectName. context is read as a skill prompt's name is: a face (NS-NAME, deriveAiFaceName) answers its one pack; a bare name resolves by D3 as a caller with no package (the environment's pack, else the one package holder, else 409 RESOURCE_CONFLICT naming each candidate by its face). RecordContextDoor gains an optional packageNamespace(packageId); the tool description teaches NAMESPACE-NAME.
  • Both MCP doors place a pack's package. The /mcp route (packages/runtime/src/domains/mcp.ts) implements packageNamespace through packageNamespaceOf, on the engine resolved beside the listContextPacks read, as listSkills does. The stdio bridge (packages/mcp/src/stdio-data-bridge.ts) implements it from its engine's registry (the objectql service, the same record installedPackageNamespace reads for skill prompts). Both sit on top of fix(mcp,runtime): get_record_context reads a package's context packs on both MCP doors #37255's stripReadDecorations listing, unchanged.
  • The several-packs answer (triage row 7154571964, ADR-0160 D4 step 3 as amended by docs(adr): ADR-0160 amended — a related child this caller is not served is left out; pack selection conditions; carried-text bound #37196): each pack is listed by its face with its label, in en and zh-Hans; a pack with a blank label is listed by its face alone.
  • The overlay consequence (card What 4, ADR-0150 D4 as ruled for skill): a package-less ai_context row under a name a package ships is that holder's customization and is not served, read at (type, name) whatever the row's root. Measured by a §5 pin with a control in packages/metadata-protocol/src/protocol.reads-environment-only.test.ts.
  • ADR-0087 semantic entry packages/spec/src/migrations/entries/semantic/18.ai-context-package-scoped-name.ts, registered by the changeset's registered ai-context-package-scoped-name marker.

Narrowings, each measured on first-party trees (objectstack at d7f299c0, re-read at this head; hotcrm at 9b735103): the one declarer of packs, examples/app-showcase (src/ai/record-context.ai-context.ts), ships two packs of different names (showcase_project_brief, showcase_task_notes) in one package; hotcrm declares none.

Narrowing First-party count
A second holder of a pack name inside one namespace: refused at install (422 NAMESPACE_CONFLICT) and by os validate 0
GET /api/v1/meta/ai_context/NAME with no package, for a name two packages hold: first match becomes 409 RESOURCE_CONFLICT 0
A package-less pack row under a name a package ships: not served (the holder's customization) 0

Tests

  • packages/mcp/src/mcp-record-context-tools.test.ts: a new top-level describe on the stdio bridge whose engine's registry places two packages: each same-name pack reached by its face, alike over MCP-over-HTTP and stdio; the bare name refused 409 naming both faces; a control engine with no registry spells each pack bare, so no face reaches one (404).
  • packages/runtime/src/mcp-record-context-tools-bridge.test.ts: in the real-protocol /mcp harness, two packages of two namespaces ship rcd_brief on one root: each is reached by its face, and the bare name is refused 409 naming both. The door's member pin lists packageNamespace.
  • packages/services/service-record-context/src/__tests__/record-context-tools.test.ts: a new top-level describe for selection by (package, name): each of two packages' same-name packs reached by its face; the bare name refused 409 naming both faces with nothing read; uninstalling one holder keeps the other; environment pack first under D3; the root narrows before D3 picks; the several answer by face and label in en and zh-Hans, with the blank-label fallback; a door without packageNamespace.
  • packages/metadata/src/metadata-manager-keyed-plural-read.test.ts: the pinned slotted set gains ai_context, so every plural-read case runs for it.
  • packages/metadata/src/loaders/database-loader.test.ts (metadata: the boot priming pass primes one holder per name for unbundled slotted types, so a bare read of a two-holder name answers the last row saved instead of 409 (epic red line 2) #32521 priming): the two host-file cases spelt the host's file helper.TYPE.yml, which the pass never reads for ai_context (the registry declares **/*.ai-context.yml). They now spell the file from the type's registry pattern. Every assertion is unchanged, and the ai_context cases assert the slotted behaviour every other type already had.
  • objectql and CLI enumeration pins (registry-namespace-co-owner-names, package-scoped-exact-qualifier, package-scoped-e8-readers, manifest-service-residual-namespace-name, the CLI's namespace-co-owner-names) list ai_context where it moved.

Acceptance notes

Verification

Local readings

Each run under scripts/pm/os-verify-lock.sh, exit taken from its VERDICT command-exit line. Readings taken at 6cb32813 (main merged at 057cedfa, which carries #37255). The head is now 74085439: the two commits since change only the changeset's Clause-② line and the semantic entry's reason plus the first BREAKING bullet (422 NAMESPACE_CONFLICT). The dogfood battery was re-run on 74085439 (see below). The suites the door commits touch were re-run there; the rest were read at c61fb9f7, and the merge brought no change to their packages (packages/spec, core, objectql, metadata, metadata-protocol untouched by it).

Command Head Result
pnpm --filter @objectstack/mcp test 6cb32813 85 files, 1507 tests passed · exit 0
pnpm --filter @objectstack/runtime test 6cb32813 647 files; 11997 passed, 25 skipped · exit 0
pnpm --filter @objectstack/service-record-context test 6cb32813 2 files, 82 tests passed · exit 0
typecheck mcp, runtime 6cb32813 exit 0 each
pnpm --filter @objectstack/core test c61fb9f7 157 files, 3761 tests passed · exit 0
pnpm --filter @objectstack/objectql test c61fb9f7 638 files, 14423 tests passed · exit 0
pnpm --filter @objectstack/metadata test c61fb9f7 83 files, 2798 tests passed · exit 0
pnpm --filter @objectstack/metadata-protocol test c61fb9f7 370 files passed, 9 skipped; 23419 tests passed · exit 0 (§5 pin and its control both ran and passed)
pnpm --filter @objectstack/spec exec vitest run src/migrations src/api c61fb9f7 69 files, 2339 tests passed · exit 0
pnpm --filter @objectstack/cli exec vitest run --project unit src/utils/namespace-co-owner-names.test.ts c61fb9f7 31 tests passed · exit 0
typecheck service-record-context, metadata, core, objectql, metadata-protocol, spec, cli c61fb9f7 exit 0 each

The #32521 host-file pins before the fixture fix: 2 failed / 539 passed (the two ai_context host-file cases; the pass read no file). After: 541 passed, 23 of them ai_context cases.

Ablations (once each, after committing; restore proven by blob equal to HEAD): deleting the stdio bridge's packageNamespace member turns both face cases of the new mcp describe red (2 failed, the control passes). Deleting the /mcp door's member turns the runtime face case and the member pin red (2 failed).

The CLI integration layer and test:repo were not run locally; CI runs them.

Gate sweep (dispatch-gates --commands)

node scripts/pm/dispatch-gates.mjs --commands at 6cb32813: 105 derived commands, each run with its exit code recorded. --ran: 105 derived, 105 run, 0 NOT MEASURED (a derived zero: every line carries its exit code).

  • 104 exit 0 on the first run.
  • pnpm check:type-check-debt: exit 3 on the first run (lock queue-timeout behind the dogfood run, nothing measured). Re-run under the lock: exit 0.
  • check:adr-0087-registration: registered ai-context-package-scoped-name (new here: ai-context-package-scoped-name).
Dogfood battery

Head 74085439 (the current head; the os-dev-report is #37216 comment 7169906867): the full battery under the lock gave VERDICT command-exit 0 · Test Files 487 passed, 3 skipped (490) · Tests 4128 passed, 68 skipped (4196) · no failures. Earlier reading, head 6cb32813, pnpm turbo run build --filter='@objectstack/dogfood^...' (exit 0), then pnpm --filter @objectstack/dogfood test under the lock: VERDICT command-exit 0 · Test Files 487 passed, 3 skipped (490) · Tests 4128 passed, 68 skipped (4196) · no failures. (Also run at c61fb9f7, before the door commits: the same counts.)

Read first: packages/services/service-record-context/src/read-set.ts (selectContextPack, the face / D3 order), packages/spec/src/api/protocol.zod.ts (the slot list, a contract surface), packages/mcp/src/stdio-data-bridge.ts (installedPackageNamespaceOf, the stdio door's new member).

Two-minute check: pnpm --filter @objectstack/service-record-context exec vitest run src/__tests__/record-context-tools.test.ts → 65 passed, including "the bare name two packages hold is refused 409, naming both faces".

Provenance

Opened by seat repo:objectstack#4 on the maintainer's authorization in the seat session (「#37216 开 PR 放行」). The dev session's (session_01QSeKYohZLmQ1Ug9FKcQtVu, zone a4-A) own relay pr_create was refused by its permission check and not retried; the dev sent the prepared body. The seat changed the dev's Clause-②: no (narrowing) to Clause-②: yes (narrowing). A narrowing arm is legal with either value; yes is right here because the diff also widens published surface: ?package= on the history and rollback doors for ai_context, a face in get_record_context's context, and new service-record-context exports. Branch claude/issue-37216-ai-context-package-scope @ 74085439.


🤖 Generated with Claude Code

https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ

… four package-scoped lists; pack selection reads faces

ADR-0150 addendum 2026-11-25: ai_context joins PACKAGE_SCOPED_TYPES,
PACKAGE_SCOPED_READ_TYPES, PACKAGE_SLOTTED_METADATA_TYPES and
NAMESPACE_UNIQUE_TYPES. get_record_context reads context as a skill
prompt's name is read: a face answers its one pack, a bare name resolves
by D3 for a caller with no package; the several answer lists each pack by
its face with its label.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzi13yZRqVcp2mGonWK
…s, D3 for a bare name, the several answer with labels

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzi13yZRqVcp2mGonWK
…name is not served, whatever its root; changeset

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzi13yZRqVcp2mGonWK
…he keyed plural-read pin's slotted set gains ai_context

Claude-Session: https://claude.ai/code/session_01QSeKYohZLmQ1Ug9FKcQtVu
Co-authored-by: Claude <noreply@anthropic.com>
…'s registry pattern, so ai_context's hyphenated suffix is read as slotted

Claude-Session: https://claude.ai/code/session_01QSeKYohZLmQ1Ug9FKcQtVu
Co-authored-by: Claude <noreply@anthropic.com>
…so get_record_context reaches each package's pack by its face

Claude-Session: https://claude.ai/code/session_01QSeKYohZLmQ1Ug9FKcQtVu
Co-authored-by: Claude <noreply@anthropic.com>
…y its face; the door's member pin lists packageNamespace

Claude-Session: https://claude.ai/code/session_01QSeKYohZLmQ1Ug9FKcQtVu
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 7 package(s): @objectstack/cli, @objectstack/core, @objectstack/mcp, @objectstack/objectql, @objectstack/runtime, @objectstack/service-record-context, @objectstack/spec, touching 48 documentable anchor(s). ⚠️ 2 changed file(s) yielded no anchor (packages/cli/src/utils/namespace-co-owner-names.ts, packages/services/service-record-context/src/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

57 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 4fb03ebbfa5a7bb6771a04bc3f41cb370c440a52.

⛔ 19 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/cli/src/utils/namespace-co-owner-names.ts, packages/services/service-record-context/src/index.ts) — pages documenting those are invisible to this run
  • 10 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 197 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 4fb03ebbfa5a7bb6771a04bc3f41cb370c440a52 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 64e40c65818e290efb011da8369d1eacf87cb2cb — the merge of head 7408543965b4dbbc8e51cf8033e51106d2e2f79d into base 4fb03ebbfa5a7bb6771a04bc3f41cb370c440a52, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 64e40c65818e290efb011da8369d1eacf87cb2cb && git checkout 64e40c65818e290efb011da8369d1eacf87cb2cb
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 4fb03ebbfa5a7bb6771a04bc3f41cb370c440a52 7408543965b4dbbc8e51cf8033e51106d2e2f79d && git checkout -B drift-repro 4fb03ebbfa5a7bb6771a04bc3f41cb370c440a52 && git merge --no-ff 7408543965b4dbbc8e51cf8033e51106d2e2f79d

node scripts/docs-audit/affected-docs.mjs --json 4fb03ebbfa5a7bb6771a04bc3f41cb370c440a52

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 4fb03ebbfa5a7bb6771a04bc3f41cb370c440a52 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…mespace is 422 NAMESPACE_CONFLICT, in the semantic entry and the changeset

Claude-Session: https://claude.ai/code/session_01QSeKYohZLmQ1Ug9FKcQtVu
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYo86w1wqy2z2fMrryr

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 7408543965b4dbbc8e51cf8033e51106d2e2f79d
Local-runs: none
Scope: packages/spec/src/api/protocol.zod.ts, packages/spec/src/migrations/entries/semantic/18.ai-context-package-scoped-name.ts + packages/core/src/package-scoped-resolution.ts, packages/objectql/src/package-scoped-read.ts, packages/objectql/src/namespace-co-owner-names.ts, packages/cli/src/utils/namespace-co-owner-names.ts, packages/services/service-record-context/src/read-set.ts, packages/services/service-record-context/src/sentences.ts, packages/services/service-record-context/src/record-context-tools.ts, packages/services/service-record-context/src/door.ts, packages/services/service-record-context/src/index.ts, packages/runtime/src/domains/mcp.ts, packages/mcp/src/stdio-data-bridge.ts
Security-touching: no
Rule-change-verified: none

What this record is. A delta over my full review of head db7b2e23, by the same reviewer. That full record was written but never posted (the write was refused by the reviewing session's permission check), so its judgments are restated here and this record stands alone on this head. The full review read card #37216 and every comment, the ADR-0150 addendum of 2026-11-25 with D2 to D6 and D9, ADR-0160 D4 as amended, the PR body, the 26-file list and the net diff against main at merge base 057cedfa. The delta is one commit, 74085439, over db7b2e23: two files, 4 lines added and 3 removed (.changeset/37216-ai-context-package-scoped.md and the semantic entry). No other file moved, so every judgment below that is not about those two files is carried from db7b2e23 unchanged.

① Derived judgments

Carried from db7b2e23; the delta changes no accept set and no public surface.

  1. PACKAGE_SLOTTED_METADATA_TYPES gains ai_context (published constant). Right: the metadata service's store, its removal and unregisterPackageWithReport are generic over the set, so each package's pack keeps its own slot and an uninstall drops one and keeps the other. It also follows that the history and rollback doors take ?package= for the type (refused 400 before), a widening the PR body does not name, and that an in-process read or removal by name with no package is refused 409 for a name two packages hold.
  2. PACKAGE_SCOPED_TYPES gains it. Right, and required by item 1: the store's read with no package asks the one rule, which throws for a type outside the list. A by-name read on a registry that cannot read by package answers 501, as for every listed type; SchemaRegistry can.
  3. PACKAGE_SCOPED_READ_TYPES gains it. Right: GET /api/v1/meta/ai_context/NAME with no package, for a name two packages hold, goes from the first match to 409 RESOURCE_CONFLICT. No reader passes a package caller for this type yet, so D3 (a) and (c) narrow nothing today.
  4. NAMESPACE_UNIQUE_TYPES gains it. Right and real at both doors: the predicate reads the aiContexts collection, installPackage throws NamespaceNameConflictError (422 NAMESPACE_CONFLICT), and os validate prints the same sentence.
  5. get_record_context: context accepts a face, a bare name resolves by D3 for a caller with no package, the several answer lists face and label, a two-holder refusal names each candidate. Right against the addendum's reader 1 and point 2.
  6. @objectstack/service-record-context: new exports, a changed selectContextPack signature and outcome members, recordContextReadSet().pack as the face, an optional RecordContextDoor.packageNamespace. No importer outside the package in this repository; the changeset states each.

② Semver level

  • Six packages at minor for Metadata-protocol: narrowed: met. The changeset carries both declaration lines, the BREAKING banner with a count per narrowing, the one-line fix and one ADR-0087 marker matching the entry's id. The delta leaves all of that as it was.
  • Clause-②: yes (narrowing) holds on the tree: yes for the widenings in items 1, 5 and 6, the arm for items 1, 3 and 4. The claim comments on the card (7155305628, 7157432984) still read no (narrowing); the seat reconciles that line. A card that only narrows is no (narrowing); this one is yes because it also widens.
  • The first BREAKING bullet now reads 422 NAMESPACE_CONFLICT, as the tree answers.

③ Boundary flags

④ Design judgment

The delta, packages/spec/src/migrations/entries/semantic/18.ai-context-package-scoped-name.ts. Holds. The entry's reason now reads "refused at install (422 NAMESPACE_CONFLICT, naming every holder) and by os validate". That is the envelope NamespaceNameConflictError carries (code NAMESPACE_CONFLICT, status and httpStatus 422), the one the pins assert for the type, and the spelling the sibling entries use. "Naming every holder" is true of the refusal: each conflict lists every other package of the namespace that holds the name. The rewrap of the following sentence changes no word. The changeset's first BREAKING bullet carries the same words, and the PR body's narrowing table was corrected to 422 NAMESPACE_CONFLICT as well. The three 409 that remain in the entry and the changeset are the by-name read and the get_record_context refusals, which do answer 409 RESOURCE_CONFLICT.

S1: closed

Carried from db7b2e23, unchanged by the delta.

  • packages/spec/src/api/protocol.zod.ts: holds. One row in the list the addendum names, read by its first consumer as item 1 says.
  • The entry's disposition (a semantic entry with no conversion and no relevance question), its surface, replacement and acceptance criteria: hold.
  • read-set.ts: holds. The root narrows first; a face answers its one pack; a face two packs derive is refused naming each holder; a bare name goes to the one rule with no caller package. It is lookupSkillPrompt's order, with one stricter step (two rows of one holder are refused). No arrangement I tried picks silently: an environment pack beside a package pack, a door that cannot place a package, two packages of a shareable namespace, a shared face among several with context omitted.
  • sentences.ts: holds against ADR-0160 D4 step 3 as amended, in en and zh-Hans, with the blank-label fallback pinned.
  • record-context-tools.ts, door.ts, index.ts, both MCP doors, and the three list files with the cli header: hold.

Nits, accepted as they stand (no effect on correctness or the contract). N1: in packages/mcp/src/stdio-data-bridge.ts the new helper sits between createStdioDataBridge's docblock and the function, so the exported function lost its doc comment. N2: two comments outside the diff still count the lists without the pack (package-slotted-store.ts, registry.ts). N3: the context describe, with #37141. N4: the entry's "at once" for migrateDatabaseLoaderRowPackages leaves out the stamp-only rows that migration does not bind, as the sibling tool-names-per-namespace entry does. Each is a follow-up, not a commit on this PR.

No must-fix, no should-fix.

Implemented-by: claude/issue-37216-ai-context-package-scope
Reviewed-by: session_01QSeKYpRe9nAK9bihJTbn9Q

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — REWORK · L1 · head 7408543965b4dbbc8e51cf8033e51106d2e2f79d · 2026-11-25T16:57Z

Read. I read card #37216 and every comment, the ADR-0150 addendum of 2026-11-25 (reader 1, D2, D3, D6 and the overlay paragraph), the dev's two closing reports, the PR body, the contract-review PASS 7168612536, and the full net diff against merge base 057cedfa (26 files, +668/−60).

Checklist.

  • Shape (from l1-face.mjs --pr 37291): draft, base main, first line Fixes #37216, and no closing keyword binds any other card. Fixes is right: the card's four lists, reader 1, the several-packs label row (triage 7154571964) and the narrowing counts are all delivered.
  • Fix against the card and the addendum: it holds.
    • ai_context joins all four lists: PACKAGE_SCOPED_TYPES, PACKAGE_SCOPED_READ_TYPES, PACKAGE_SLOTTED_METADATA_TYPES and NAMESPACE_UNIQUE_TYPES. The last one also gains its type union and its header.
    • selectContextPack filters by root first. A face then answers its one pack. A bare name goes to resolvePackageScopedHolders with no caller package. A face that two packs derive is refused, naming each holder. This is reader 1 as ruled.
    • Both MCP doors implement packageNamespace. /mcp resolves its engine beside the listContextPacks read. The stdio door reads engine.registry.getPackage.
  • Tests:
  • Narrowing declared fully:
    • The PR body and changeset both read Clause-②: yes (narrowing) and Metadata-protocol: narrowed.
    • Six packages are at minor.
    • The changeset carries the BREAKING (narrowing) banner with a first-party count per narrowing, and the one-line fix.
    • The ADR-0087 marker registered ai-context-package-scoped-name equals the entry's id.
    • I re-measured the first-party counts on origin/main at 829a45e9. examples/app-showcase is still the one declarer and has two distinct names (showcase_project_brief, showcase_task_notes), so every arm counts 0.
  • Changeset, read sentence by sentence against the diff:
    • The four-lists bullet holds.
    • The get_record_context bullet holds: 400 VALIDATION_ERROR for several packs, face plus label, the face-alone fallback, and NAMESPACE-NAME in the description.
    • The new-door-member bullet holds.
    • The new-exports bullet holds. index.ts exports exactly contextPackCandidates, ContextPackCandidate, ContextPackCandidateName and PackageNamespaceOf.
    • BREAKING 1 holds: NamespaceNameConflictError is 422 with code NAMESPACE_CONFLICT (registry.ts:1638).
    • BREAKING 2 holds: the by-name read gives 409 RESOURCE_CONFLICT.
    • BREAKING 3 holds: it matches the addendum's overlay paragraph.
  • Check-runs at head: 73 in total, 60 success and 13 skipped. l1-face reads all 13 skips as expected and 0 as unexpected, with 0 failed and 0 pending. Lint & Repo Gates and TypeScript Type Check are both success. The Dogfood Regression Gate shards are skipped on the PR by design, so CI does not stand in for the battery.
  • Merge state: git merge-tree --write-tree origin/main 74085439 with origin/main at 829a45e9 merges clean (exit 0), and mergeable_state reads clean.
  • K: landing-k.mjs --pr 37291 gives K = 9 against PRBASE 4fb03ebb, the last green Test Core, run 45627122732 on this head. The locale leg has no new pack, and the shared-budget leg has no book under this PR. Result: OK, under 15.
  • Claim reading:
    • latestMarkedComment over the Claim: marker picks 7157432984 as the newest claim (created 2026-11-25T08:45Z, edited 2026-11-25T13:51Z). It now reads Clause-②: yes (narrowing).
    • Seat 3's 7155305628 reads no (narrowing) and is answered by its Release: 7156321844.
    • 7164215174 carries the line but has no Claim: marker, so the tooling does not read it as a claim.
    • The landing readers take the line from the PR body, which reads yes (narrowing): --land's dogfood gate, l1-face and check-owed-reviews.

Open items.

M1 (must-fix, owed by the zone) — The dogfood battery does not cover the head.

  • The dev ran the full battery at 6cb32813 (VERDICT command-exit 0, Test Files 487 passed, 3 skipped; Tests 4128 passed, 68 skipped). The head is two single-parent commits above it:
    • db7b2e23 changes the changeset's declaration line;
    • 74085439 changes the semantic entry's reason and the changeset's first BREAKING bullet.
  • landDogfoodGate's first-parent walk accepts only merges of the base, so the dev's "text only, results still apply" is no pass.
  • The os-dev-report was never posted on 37180 跟进:资料包(ai_context)进入按包分桶的四张表,get_record_context 按应用+名字选包 #37216: post-stamped was refused in the dev container. That is the dev's open question.
  • I ran the gate function read-only (label-write.mjs's landDogfoodGate, with gh api -X GET as its only reader). It answers: --land REFUSED … why: card #37216 carries no os-dev-report by objectstack-fleet[bot] / os-zhuang (8 comment(s) read). If that report were posted as written, the walk would still refuse at 74085439 (1 parent).
  • Clears when the full battery runs on 74085439, or on a later head reached from it only by base merges, and an os-dev-report goes on 37180 跟进:资料包(ai_context)进入按包分桶的四张表,get_record_context 按应用+名字选包 #37216 by the relay identity with dogfood_battery opening with that sha. That also answers the dev's open question (option A, posted by the zone).

M2 (must-fix, owed by the seat) — Skills-docs: follow-up #37177 is not true yet.

S1 (should-fix, seat, with the re-pin after M1) — The PR body is stale or wrong in three places.

  • (a) ## Verification says "Final head 6cb32813", the dogfood block reads 6cb32813, and ## Provenance ends "@ 6cb32813". Restate them at the head that M1 runs on.

  • (b) ## Provenance says the dev's no (narrowing) was malformed because "the narrowing arm goes with yes". clause2-line.mjs reads no (narrowing) as a legal declaration, and only no (widening) is malformed. The reason for yes is this PR's widenings:

    • the history and rollback doors' ?package= for ai_context;
    • a face accepted in context;
    • the new service-record-context exports.

    ## What changes should name the first of those, which the contract review also noted.

  • (c) The ## 维护者速读 last line reads 「要你做什么:无」. A narrowing hands off for approval, so the seat record's speed-read replaces it with the approval request, naming PASS 7168612536 and Head-sha. The body's line should match.

N1 — In packages/mcp/src/stdio-data-bridge.ts, installedPackageNamespaceOf sits between createStdioDataBridge's docblock and the function. This is confirmed at the head and matches the contract review's N1. It is a follow-up, not a commit here.

N2 — l1-face flags the changeset for @objectstack/cli, @objectstack/metadata and @objectstack/metadata-protocol. None is owed:

  • metadata and metadata-protocol are touched in test files only, and those packages ship dist;
  • cli's edit is a docblock in src/utils/namespace-co-owner-names.ts. os validate's new refusal arrives through @objectstack/objectql's minor, which is a workspace dependency, not bundled.

N3 — Seat comment 7164215174 on the card is wrong on two points:

  • it calls no (narrowing) malformed;
  • it says 7157432984 reads that line, which stopped being true with the 2026-11-25T13:51Z edit.

An append-only correction is optional. No reader depends on it.

N4 — record-context-tools.zod.ts's context describe still says "by name". It is routed to #37141 and accepted.

Next. After M1 and M2 clear, the seat re-reads the delta. If the head is still 74085439, PASS 7168612536 stands. A head that moved owes a delta contract review before the hand-off. The PR then goes to the maintainer as a narrowing. After approval, the seat lands it, merging main first if K ≥ 15.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — ACCEPT · L1 · head 7408543965b4dbbc8e51cf8033e51106d2e2f79d · 2026-11-25T17:45Z

  • Same-head delta over the L1 REWORK 7168795400. The head is unchanged, so the contract review PASS 7168612536 stands.
  • M1: closed. A full dogfood battery ran on 74085439 (VERDICT command-exit 0; Test Files 487 passed, 3 skipped; Tests 4128 passed, 68 skipped; 0 failures). It is posted as os-dev-report 7169906867 on 37180 跟进:资料包(ai_context)进入按包分桶的四张表,get_record_context 按应用+名字选包 #37216, with dogfood_battery opening with the head sha. Read-only, the landing gate's dogfood check finds the report and reads 0 hops from the head.
  • M2: closed. The seat's scope note 7168812660 on 37140 跟进:技能文档教作者写资料包(ai_context) #37177 names the four author-facing changes, so Skills-docs: follow-up #37177 is now true.
  • S1: closed. The PR body is re-pinned. Verification and Dogfood name 74085439 and the new report. Provenance states why the value is yes: the diff widens too (history/rollback ?package=, the face in context, the new exports). The 维护者速读 asks for approval and names the PASS and the head.
  • N1–N4 stand as recorded (follow-ups, no head change).
  • No must-fix, no should-fix.
  • Landing: narrowing, handed to the maintainer. After approval the seat lands it; K = 9 (below 15), so no main merge is owed.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

维护者速读

  • 用户能看到什么变化:两个应用各自带同名资料包时,外部 AI 通过 MCP 读记录资料,可以按「应用前缀-名字」分别选中各自的包;只给名字而两个应用都有这个名字时,会被明确拒绝,并列出每个可选写法。同一个应用里出现第二个同名资料包,安装和 os validate 都会拒绝。
  • 为什么做:落实已合并的 ADR-0150 补充裁决,资料包和技能一样按「应用+名字」识别;属于「在一条记录上问 AI」专题,也为后续「技能指定资料包」扫清前提。
  • 出错会怎样:只影响资料包的选取和同名校验;第一方应用里没有任何同名资料包(三项收窄实测都是 0),现有部署读到的结果不变,可直接撤回。作者文档的配套更新在 37140 跟进:技能文档教作者写资料包(ai_context) #37177。
  • 要你做什么:这是收窄改动,请你批准;批准后由席位合入。契约审核通过记录是 PR comment 7168612536,Head-sha 7408543965b4dbbc8e51cf8033e51106d2e2f79d。

Approval request at 2026-11-25T17:46Z. Seat opinion: approve. Seat L1 is ACCEPT (7169974561) and the CONTRACT_REVIEW_TIER review is PASS (7168612536), both on this head. The full dogfood battery passed on this head (os-dev-report 7169906867), and the landing gate reads it at 0 hops. Each of the three narrowings measures 0 on first-party trees. K = 9 and merge-tree is clean. Four nits remain as follow-ups; none needs a head change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

37180 跟进:资料包(ai_context)进入按包分桶的四张表,get_record_context 按应用+名字选包

3 participants